import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: "/index/home"
  },
  {
    path: '/index',
    name: 'Index',
    component: () => import(/* webpackChunkName: "index" */ '../views/Index/index.vue'),
    children: [
      {
        path: '/index/home',
        name: 'Home',
        component: () => import(/* webpackChunkName: "Home" */ '../views/Home/index.vue'),
      },{
        path: '/index/forum',
        name: 'Forum',
        component: () => import(/* webpackChunkName: "Forum" */ '../views/Forum/index.vue'),
      },{
        path: '/index/choose',
        name: 'Choose',
        component: () => import(/* webpackChunkName: "Choose" */ '../views/Choose/index.vue'),
      },{
        path: '/index/site',
        name: 'Site',
        component: () => import(/* webpackChunkName: "Site" */ '../views/Site/index.vue'),
      },{
        path: '/index/my',
        name: 'My',
        component: () => import(/* webpackChunkName: "My" */ '../views/My/index.vue'),
      }
    ]
  },
  {
    path: '/detail',
    name: 'Detail',
    component: () => import(/* webpackChunkName: "Detail" */ '../views/Detail/index.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
